package com.dz.lm.dao.product.read;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.dz.lm.common.exception.DaoException;
import com.dz.lm.common.utils.stereotype.ReaderRepository;
import com.dz.lm.domain.product.AgentProduct;

@ReaderRepository("readAgentProductDao")
public interface AgentProductDao {
	
	List<AgentProduct>ListAgentProduct() throws DaoException;
	
	AgentProduct selectByPrimaryKey(Map<String, Object> param)throws DaoException;
    /**
     * 查询当前用户代理的产品列表
     */
    List<Map<String, Object>> qryMyAgentProductList(Map<String, Object> qryParam) throws DaoException;
    /**
     * 查询当前用户代理的产品总数
     */
    Integer qryMyAgentProductListCount(Map<String, Object> qryParam) throws DaoException;
    /**
     * 查询当前用户的某个下级的代理的产品列表
     */
    List<Map<String, Object>> qryUserAgentProductList(Map<String, Object> qryParam) throws DaoException;
    /**
     * 查询当前用户的某个下级的代理的产品总数
     */
    Integer qryUserAgentProductListCount(Map<String, Object> qryParam) throws DaoException;
    /**
     * 获取代理的产品的申请信息列表
     */
    List<Map<String, Object>> qryMyAgentProductApplyList(Map<String, Object> qryParam) throws DaoException;
    /**
     * 获取代理的产品的申请信息条数
     */
    Integer qryMyAgentProductApplyListCount(Map<String, Object> qryParam) throws DaoException;
    /**
     * 查询我创建的和代理的产品的申请信息列表
     */
    List<Map<String, Object>> qryMyAllProductApplyList(Map<String, Object> qryParam) throws DaoException;
    /**
     * 查询我创建的和代理的产品的申请信息条数
     */
    Integer qryMyAllProductApplyListCount(Map<String, Object> qryParam) throws DaoException;
    
    List<Map<String, Object>> qry1LevelAgentProductList(Map<String, Object> qryParam) throws DaoException;
    
    
    Integer qry1LevelAgentProductListCount(Map<String, Object> qryParam) throws DaoException;
    
    
    Integer qry1LevelAgentProductApplyCount(@Param("agentProductId") Integer agentProductId) throws DaoException;
    
    
    List<Map<String, Object>> qryAll1LevelAgentProductList(Map<String, Object> qryParam) throws DaoException;
    
    
    List<Map<String, Object>> qry2LevelAgentProductList(Map<String, Object> qryParam) throws DaoException;
    /**
     * 查询当前用户代理的产品的下级列表
     */
    List<Map<String, Object>> qryLowLevelAgentList(Map<String, Object> qryParam) throws DaoException;
    /**
     * 查询当前用户代理的产品的下级条数
     */
    Integer qryLowLevelAgentListCount(Map<String, Object> qryParam) throws DaoException;
    /**
     * 查询当前用户的代理人列表
     */
    List<Map<String, Object>> qryMyAgentList(Map<String, Object> qryParam) throws DaoException;
    /**
     * 查询当前用户的代理人条数
     */
    Integer qryMyAgentListCount(Map<String, Object> qryParam) throws DaoException;
    /**
     * 查询当前用户代理的产品的累计进件单数
     */
    Map<String, Object> qryTotalApplyCount(Map<String, Object> qryParam) throws DaoException;
    /**
     * 查询某个代理产品进件明细列表
     */
    List<Map<String, Object>> qryAgentProductApplyList(Map<String, Object> qryParam) throws DaoException;
    /**
     * 查询某个代理产品进件明细条数
     */
    Integer qryAgentProductApplyListCount(Map<String, Object> qryParam) throws DaoException;
    /**
     * 获取我的代理人下【累计推送】信息列表
     */
    List<Map<String, Object>> qryUserAgentProductApplyList(Map<String, Object> qryParam) throws DaoException;
    /**
     * 获取我的代理人下【累计推送】信息条数
     */
    Integer qryUserAgentProductApplyListCount(Map<String, Object> qryParam) throws DaoException;
    /**
     * 通过产品ID查询代理产品的详细数据
     */
    Map<String, Object>qryAgentProductByProductId(Map<String, Object> qryParam) throws DaoException;
    /**
     * 查询该代理人在该钱吧下是否还代理了其他产品
     */
    Integer qryOtherAgentProductCount(Map<String, Object> qryParam) throws DaoException;
    /**
     * 查询该代理人在该钱吧下是否还代理了其他产品
     */
    Integer qryOtherAgentProductCount2(Map<String, Object> qryParam) throws DaoException;
    /**
     * 通过产品ID查询代理产品信息
     */
    Map<String, Object>qryAgentProductInfoByProductId(Map<String, Object> qryParam) throws DaoException;
    /**
     * 查询二级代理的上级代理人信息
     */
    Map<String, Object> qryUpAgentInfo(Map<String, Object> param) throws DaoException;
    /**
     * 查询某个下级在该钱吧下所代理的产品列表
     */
    List<Map<String, Object>> qryAgentProductListByAgentId(Map<String, Object> qryParam) throws DaoException;
    /**
     * 统计历史申请数及累计收入
     */
    Map<String, Object> qryMyAllProductApplyTotal(Map<String, Object> param) throws DaoException;
}
